home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / t_os / tool / tpsc32k / src / nega.c next >
Encoding:
C/C++ Source or Header  |  1994-11-16  |  2.2 KB  |  96 lines

  1. /*
  2.         TPSC32K用 外部Shell
  3.         
  4.         ぼかしユ-ティリティ
  5.         
  6. */
  7.  
  8. #define EGBSIZE        1536    // EGB用ワ-クサイズ
  9. #define MOSSIZE        4096    // マウス用ワ-クサイズ
  10. #define BOOL        int        // 論理判断の型宣言
  11. #define TRUE        1        // 真
  12. #define FALSE        0        // 偽
  13. #define MENUPAGE    0        // メニュ-ペ-ジ番号
  14. #define DRAWPAGE    0        // 描画ペ-ジ番号
  15. #define SCREEN        17        // 画面モ-ド
  16. #define DRAWWIDE    512        // 処理画面横サイズ
  17. #define DRAWHIDE    480        // 処理画面縦サイズ
  18. #define    WHITE    0x7fFF
  19. #define FORECOLORNO        0
  20. #define BACKCOLORNO        1
  21. #define PAINTCOLORNO    2
  22. #define TRANSCOLORNO    3
  23. #define PSET       0
  24. #define PRESET     1
  25. #define OR         2
  26. #define AND        3
  27. #define XOR        4
  28. #define NOT        5
  29. #define MATTE      6
  30. #define PASTEL     7
  31. #define OPAQUE     9
  32. #define IMPSET    10
  33. #define IMPRSET   11
  34. #define IMPNOT    12
  35. #define MASKSET   13
  36. #define MASKRESET 14
  37. #define MASKNOT   15
  38.  
  39. #include <stdio.h>
  40. #include <stdlib.h>
  41. #include <string.h>
  42. #include <malloc.h>
  43. #include <math.h>
  44. #include <egb.h>
  45. #include <mos.h>
  46. #include <loader.h>            // コプロセス定義ファイル
  47.  
  48. char EGB_work[EGBSIZE];        // EGBワ-クエリア
  49. char MOS_work[MOSSIZE];        // マウスワ-クエリア
  50.  
  51. void nega(x1,y1,x2,y2)
  52. int x1,y1,x2,y2;
  53. {
  54.     struct { short x1,y1,x2,y2; } par;
  55.  
  56.     EGB_writeMode(EGB_work,XOR);
  57.     EGB_paintMode(EGB_work,0x20);
  58.     EGB_color(EGB_work,PAINTCOLORNO,WHITE);
  59.     par.x1 = x1; par.y1 = y1;
  60.     par.x2 = x2; par.y2 = y2;
  61.     EGB_rectangle(EGB_work,(char *)&par);
  62.     EGB_writeMode(EGB_work,PSET);
  63. }
  64.  
  65. main()
  66. {
  67.     ADDRESS temp;
  68.     int i,x,y;
  69.     int page[2];
  70.     
  71.     pcl_get_dta(&temp);
  72.     
  73.     /* 画面・マウスの初期化 */
  74.     EGB_getResolution(&page[0], &page[1]);
  75.     if( page[0] == SCREEN ) {
  76.         EGB_resolution(EGB_work,DRAWPAGE,page[0]|0x40);        // Page0 Init
  77.         EGB_displayPage(EGB_work,0,1);                        // 1page view
  78.         MOS_start(MOS_work,MOSSIZE);                        // マウス初期化
  79.         MOS_resolution(DRAWPAGE,page[0]);
  80.         
  81.         EGB_writePage(EGB_work,DRAWPAGE);    // 描画ペ-ジを指定
  82.         EGB_paintMode(EGB_work,0x22);        // ペイントモ-ドを指定
  83.         EGB_color(EGB_work,0,WHITE);            // ドットの色を指定
  84.         EGB_writeMode(EGB_work,0);
  85.     
  86.         /* 処理開始 */
  87.         nega(0,0,DRAWWIDE-1,DRAWHIDE-1);
  88.     
  89.         /* 子プロセスの終了処理 */
  90.         MOS_end();
  91.     }
  92.     
  93.     pcl_exit(0);
  94.     return (0);
  95. }
  96.